<?php
/**
 * Prepared Statement Interface.
 * 
 * @author Patrick J. Mizer
 * @package junction.db.common
 */
interface Junction_Db_Common_PreparedStatement 
{
	/**
	 * Execute a SELECT prepared statement.
	 * 
	 * @throws Junction_Db_Common_SqlException
	 * @param array SQL parameters.
	 * @return Junction_Db_Common_ResultSet
	 */
	public function executeSelect(array $params = null);

	/**
	 * Execute a non SELECT prepared statement.
	 * 
	 * @throws Junction_Db_Common_SqlException
	 * @param array SQL parameters.
	 * @return boolean
	 */	
	public function executeSave(array $params = null);
	
	/**
	 * Returns the prepared statement's query
	 * 
	 * @return string 
	 */
	public function getQuery();
	
	/**
	 * Returns the number of rows affected by the previous query
	 *
	 * @return int number of affected rows
	 */
	public function affectedRows();
	
	/**
	 * Returns the key for the previously inserted row
	 *
	 * @return int last key inserted
	 */
	public function lastInsertId();
	
}
?>
